﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MissileControl;

namespace ThunderSmurfsTDS
{
    public partial class Frm_Developer : Form
    {
        MissileControl.MissileControl mc;
        ImageDetection.CameraDetect cd;
        public Frm_Developer()
        {
            InitializeComponent();
            cd = new ImageDetection.CameraDetect();
            cd.OnUpdate += updateBitmap;
            mc = new MissileControl.MissileControl();
        }

        private void btn_Launch_Click(object sender, EventArgs e)
        {
            TargetingInfo.TargetInfo ti = new TargetingInfo.TargetInfo();
            ti.IsFoe=true;
            ti.X=Double.Parse(txt_X.Text);
            ti.Y=Double.Parse(txt_Y.Text);
            ti.Z=Double.Parse(txt_Z.Text);
            mc.AimAndFire(ti);
        }
        private void updateBitmap(Bitmap bm)
        {
            pictureBox1.Image = bm;
        }

        private void btn_toggleVid_Click(object sender, EventArgs e)
        {
            cd.toggleImageDetect();
        }
    }
}
